﻿<!DOCTYPE>
<html>
<head>
    <title>微街秀 > 分享记录</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <link rel="stylesheet" type="text/css" href="css/css.css">
    <link rel="stylesheet" type="text/css" href="css/Makeresult.css">
    <script src="js/ajax-data.js" type="text/javascript"></script>
    <script src="js/jquery-2.1.4.min.js" type="text/javascript"></script>
    <script src="js/base.js" type="text/javascript"></script>
    <script src="js/dialog.js" type="text/javascript"></script>
</head>
<body>
    <div>
        <div class="wamtop">
            <div class="topleft" onclick="window.location.href='MakeFt.html'">
                <img src="img/5.jpg" /></div>
            <div class="topcententxt">
                分享记录</div>
        </div>
        <div class="tg_select">
        </div>
    </div>
    
    <script>
        var pagecount = "0";
        var page = 1;
        var keyword = ""; //关键词

        $(document).ready(function () {
            load(page);
            $(window).bind("scroll", function () {
                //当滚动条滚动时
                var scollTop = $(this).scrollTop() + $(this).height();
                var scollH = $(document).height();
                if (scollH - scollTop < 100) {
                    if (wait.isShow) { return; } //如果正在加载，则返回
                    page++;
                    load(page);
                }
                return false;
            });
            $("#searchico").click(function () { $("#ws_tg").html(""); load(page) });
        });
        function load(page) {
            if (pagecount == "1") { return; }
            if (!islogin()) { window.location.href = 'login.html'; return; }
            keyword = $("#Stext").val();
            AjaxStart("ajax/fc_shared.ashx?getlistshared", "&page_index=" + page, function (data) {
                if (data.code == "4") { Alert(data.msg.toString()); pagecount = "1"; return; }
                if (data.item.pageCount < page) {
                    if (pagecount == "0")
                        Alert('到底了！');
                    pagecount = "1"; return;
                }
                loadhtml(data);
            });
        }

        function loadhtml(data) {
            $(data.item.table).each(function () {
                var logo = this.logo == null ? "img/30.png" : this.logo;
                var title = this.title;
                if (title.length > 15)
                    title = title.substr(0, 15) + "...";

                $(".tg_select").append("<div class=\"centenlist\"><div class=\"centenimg\"><img src=\"" + logo + "\"></div><div class=\"cententxt\">" +
                    "<div class=\"cententxttop\" onclick=\"window.location.href='makeresultdetail.html?id=" + this.id + "&isad=0'\">" +
                    "<strong>" + title + "</strong></div>" +
                    "<div class=\"centenTime\">" + this.date.substr(0, 10) + "</div>" +
                    "<div class=\"Sharecentenflow\"><img src=\"img/Makeimg/17.png\" /> " + this.price + "元</div></div></div>");
            });
        }
    </script>
</body>
</html>
